
<include file="Public:header" />
<script type="text/javascript" src="__PUBLIC__/Home/js/cityselect.js"></script>
<div class="autobox">
 <div class="now">
  <a href="/" class="orange">首页</a> &gt; <a href="/user/" class="orange">安全中心</a> &gt; 银行卡管理
 </div>
 <div class="assets_center clear po_re zin70">
  <!--左侧菜单-->
  <include file="User:left" />
  <!--右侧内容-->
  <div class="assets_content w900 right bg_w">
   <div class="safe_center clear" style="padding-left: 0px; border-bottom: 2px solid #ed4040;">
    <h1 style="margin-top: 0px; margin-bottom: 15px; line-height: 15px;">银行卡管理</h1>
   </div>
      <notempty name="prompt_text">
                    <div class="mytips">
                        <h6 style="color: #ff8000;">温馨提示</h6>
                        {$prompt_text}
                    </div>
                </notempty>
   <br>


   <div class="cnyin_record" style="width: 918px;">
    <div class="f_body">
     <div class="f_body_main">
      <div class="f_tab_body">
       <div>
        <table class="f_table" id="investLog_content">
         <thead>
          <tr>
           <th>备注名称</th>
           <th>开户银行</th>
           <th>开户省份</th>
           <th>开户城市</th>
           <th>开户支行</th>
           <th>开户姓名</th>
           <th>银行卡号</th>
           <th>添加时间</th>
           <th>操作</th>
          </tr>
         </thead>
         <tbody>
          <volist name="UserBank" id="vo">
          <tr>
           <td>{$vo.name}</td>
           <td>{$vo.bank}</td>
           <td>{$vo.bankprov}</td>
           <td>{$vo.bankcity}</td>
           <td>{$vo.bankaddr}</td>
           <td>{$truename}</td>
           <td>{$vo.bankcard}</td>
           <td>{$vo.addtime|addtime}</td>
           <td><a class="cancel" href="javascript:void(0)" onclick="UpdateB({$vo['id']})">删除</a></td>
          </tr>
          </volist>
         </tbody>
        </table>
        <div class="pages">
         <a href="javascript:void(0)" onclick="showA()">添加一个地址</a>
        </div>
       </div>
      </div>
     </div>
    </div>
   </div>
  </div>
 </div>
</div>
<div class="okcoinPop" id="withdrawCnyAddress" style="display: none;">
 <div class="dialog_content" id="dialog_content_CnyAddress" style="margin-left: -200px; margin-top: 200px; left: 50%; top: 21px;">
  <div class="dialog_title" id="dialog_title_CnyAddress">
   <span id="CnyAddressTitle">添加一个银行地址</span> <a href="javascript:closeAddress();" class="dialog_closed" title="关闭"></a>
  </div>
  <div class="dialog_body center">
   <div style="line-height: 35px; text-align: left; padding-left: 50px;">
    <ul class="PopLayer">
     <li><span class="c2" id="lotteryAmountSpan1">备注名称:</span> <input name="name" id="bank_name" type="text" class="cztxinput" style="width: 200px; padding: 2px; padding-bottom: 5px;"></li>
     <li><span class="c2" id="lotteryAmountSpan2">开户银行:</span> <select name="bank" id="bank_bank" style="width: 110px;">
       <option value="0">--选择银行--</option>
       <volist name="UserBankType" id="vo">
       <option value="{$vo['title']}">{$vo['title']}</option>
       </volist>
     </select></li>
     <li><span class="c2" id="lotteryAmountSpan3">开户省市:</span> <span class="controls" id="city_1"> <select class="prov" id="bank_bankprov" name="prov" style="width: 110px;"></select> <select class="city" id="bank_bankcity" name="city" style="width: 110px; display: none;"></select>
     </span></li>
     <li><span class="c2" id="lotteryAmountSpan4">开户支行:</span> <input name="name" id="bank_bankaddr" type="text" class="cztxinput" style="width: 200px; padding: 2px; padding-bottom: 5px;"></li>
     <li><span class="c2" id="lotteryAmountSpan5">开户姓名:</span> {$truename}</li>
     <li><span class="c2" id="lotteryAmountSpan6">银行卡号:</span> <input name="name" id="bank_bankcard" type="text" class="cztxinput" style="width: 200px; padding: 2px; padding-bottom: 5px;"></li>
     <li><span class="c2" id="lotteryAmountSpan7">交易密码:</span> <input name="name" id="bank_paypassword" type="password" class="cztxinput" style="width: 100px; padding: 2px; padding-bottom: 5px;"> <a href="/Login/findpaypwd.html" class="reg_floatr">忘记?</a></li>
     <li><a href="javascript:void(0)" onclick="Update()" class="btn" id="btn" style="">立 即 添 加</a></li>
    </ul>
   </div>
  </div>
 </div>
</div>
<div id="dialogBoxShadow" style="position: absolute; top: 0px; left: 0px; z-index: 100; background-color: rgb(0, 0, 0); opacity: 0.4; width: 100%; background-position: initial initial; background-repeat: initial initial; display: none;"></div>
<br>
<br>
<script>
 


 $("#city_1").citySelect({nodata:"none",required:false});

 $('#dialogBoxShadow').height($(document).height());
 function closeAddress(){
  $("#withdrawCnyAddress").hide();
  $("#dialogBoxShadow").hide();
 }
 function showA(){
  $("#withdrawCnyAddress").show();
  $("#dialogBoxShadow").show();
 }

 function Update(){
  var name=$('#bank_name').val();
  var bank=$('#bank_bank option:selected').val();
  var bankprov=$('#bank_bankprov option:selected').val();
  var bankcity=$('#bank_bankcity option:selected').val();
  var bankaddr=$('#bank_bankaddr').val();
  var bankcard=$('#bank_bankcard').val();
  var paypassword=$('#bank_paypassword').val();
  if(name==""||name==null){
   layer.tips('请输入备注名称','#bank_name',{tips:3});
   return false;
  }
  if(bankaddr==""||bankaddr==null){
   layer.tips('请输入开户支行','#bank_bankaddr',{tips:3});
   return false;
  }
  if(bankcard==""||bankcard==null){
   layer.tips('请输入银行账号','#bank_bankcard',{tips:3});
   return false;
  }
  if(paypassword==""||paypassword==null){
   layer.tips('请输入交易密码','#bank_paypassword',{tips:3});
   return false;
  }


  $.post("{:U('User/upbank')}",{type:1,name:name,bank:bank,bankprov:bankprov,bankcity:bankcity,bankaddr:bankaddr,bankcard:bankcard,paypassword:paypassword},function(data){
   if(data.status==1){
    layer.msg(data.info,{icon:1});
    window.location="{:U('User/bank')}";
   }else{
    layer.msg(data.info,{icon:2});
    if(data.url){
     window.location=data.url;
    }
   }
  },"json");
 }

 function UpdateB(id){
  layer.config({
   extend: 'extend/layer.ext.js'
  });
  layer.ready(function () {
   //默认prompt
   layer.prompt({
    title: '输入交易密码，并确认',
    formType: 1},function(val){
    if (val) {
     //需要执行的方法
     $.post("{:U('User/delbank')}",{type:2,id:id,paypassword:val},function(data){
      if(data.status==1){
       layer.msg(data.info,{icon:1});
       window.location="{:U('User/bank')}";
      }else{
       layer.msg(data.info,{icon:2});
       if(data.url){
        window.location=data.url;
       }
      }
     },"json");


    };
   });

  });


 }

</script>
<script>
	//菜单高亮
	$('#user_box').addClass('active');
	$('#user_bank').addClass('active');
    $('#user_bank i').attr('class','coin_menu_op_13');
</script>
<include file="Public:footer" />